/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
jQuery(function($) {
    var fixed = false;
    var div = $("#block-dm-global-module-directory");
    if(div.length > 0) {
    var tops = div.offset().top;
    if (div.length > 0) {
        $(window).scroll(function() {
            if ($(this).scrollTop() > tops) {
                if( !fixed ) {
                    fixed = true;
                    div.addClass('directoryfixed');
                }
            } else {
                if( fixed ) {
                    fixed = false;
                    div.removeClass('directoryfixed');
                }
            }
        });
    }}
});
;
